package com.ac.api.component.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author mzl
 * @since 2020-07-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "附件", description = "")
@NoArgsConstructor
public class CpAttachment implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "上传者id")
    private Integer userid;

    @ApiModelProperty(value = "附件名")
    private String name;

    @ApiModelProperty(value = "附件类型")
    private String type;

    @ApiModelProperty("唯一识别")
    private String code;

    @ApiModelProperty(value = "附件文件路径")
    private String path;

    @ApiModelProperty(value = "附件大小")
    private String size;

    @ApiModelProperty(value = "创建时间")
    private Date createtime;

    @ApiModelProperty(value = "状态(“t”有效 “f”删除)")
    private String state;

    @ApiModelProperty(value = "标签号")
    private Integer cpLabelId;
    @ApiModelProperty(value = "服务id")
    private Integer serviceId;
    @ApiModelProperty(value = "是否公开")
    private Integer permission;


    public CpAttachment(Integer userid, String name, String path,Integer serviceId){
        this.userid=userid;
        this.name=name;
        this.path=path;
        this.serviceId=serviceId;
        this.createtime=new Date();
        this.state="t";
    }

}
